import json
import string


rs = []

def t(data):
    #print("data=>%s" % data)
    for item in data:
    	if isinstance(item, list):
    		if item and item[0]:
	    		rs.append(int(item[0]))
	    		if isinstance(item[1], list):
	    			if item and item[1]:
	    				t(item[1])
    	else:
    		rs.append(int(item))
    return rs


d = '[["1",[[]]],["12",[["2",[]],["3",["18","19","20","21"]],["4",[]],["5",[]]]],["13",[["6",[]],["7",[]]]],["14",[["8",[]],["9",[]],["10",[]],["11",[]]]],["15",[["16",["17"]],["22",[]],["23",[]]]]]'

role_menu = json.loads(d)

all_menu = t(role_menu)

print("tt=>%s" % all_menu)


def role_menu_access(*menu_id):
	print(set(all_menu))
	print(set(menu_id))
	menu_same = list(set(menu_id).intersection(set(all_menu)))
	print(menu_same)

role_menu_access(24)